-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touch Controls #1104
base: dev
Are you sure you want to change the base?
Touch Controls #1104
Conversation
Moving on to create a joystick
/** @returns {number} a number between -1 and 1 for this input. */ | ||
abstract getValue(useGamepad: boolean): number | ||
// Returns the current value of the input. Range depends on input type | ||
abstract getValue(useGamepad: boolean, useTouchControls: boolean): number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if instead of getValue()
taking in useTouchControls
and useGamepad
, the input scheme stored an enum InputType, replacing the boolean it currently has called useGamepad
? That would avoid different input type conditions originating from different places and potentially overriding each other.
export enum InputType {
KEYBOARD,
GAMEPAD,
TOUCH
}
export type InputScheme = {
schemeName: string
descriptiveName: string
customized: boolean
inputType: InputType
inputs: Input[]
}
@@ -18,8 +20,8 @@ abstract class Input { | |||
this.inputName = inputName | |||
} | |||
|
|||
/** @returns {number} a number between -1 and 1 for this input. */ | |||
abstract getValue(useGamepad: boolean): number | |||
// Returns the current value of the input. Range depends on input type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every input should be between -1 and 1 for consistency
Changes that need to be made: Only one of the usegamepad and usetouchcontrols checkboxes can be selected at a time When creating a new scheme you may click an add joint button to add another joint configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, but I have a couple requests and recommendations:
-
If you aren't on a device that supports touch controls, the touch control scheme should not be selectable because there's not way to control it. If we keep a similar button, consider making it more opaque and blurring the background.
-
Instead of a button to open touch controls, they should automatically appear if there's a robot spawned that uses them.
-
The place assembly button text is really hard to read with some backgrounds. It also looks a little out of place. I think this is because the colors and style are so different than the others buttons. Maybe it could appear on the panel that that loading bar is on once it finishes loading?
-
When I connect to the network version, I get the error
Uncaught TypeError: can't access property "getDirectory", navigator.storage is undefined MirabufLoader.ts:29
. Is this just me?
Description
Creating touch controls joysticks for mobile devices. To enable the touch controls, you must be on a device with touch capabilities. When this happens, the Enable touch controls button will appear in the MainHUD.
After enabling the touch controls the controls themselves will appear on screen.
To use them, you must configure a inputscheme or use the preset "Brandon"
Notes
JIRA Issue